
<div class="content-scrol">
<div class="content">
    <div class="content-title">
        <div class="ct-textarea" contenteditable="false">
            修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题
            ,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题
            ,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题,修改标题
        </div>
        <div class="ct-but">修改标题</div>
    </div>
    <div class="content-section">
        <div class="null15"></div>
        <div class="content-img">
            <img class="ci-img" src='https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=3231897502,2872604692&fm=58&bpow=400&bpoh=256' />
            <div class="ci-del">删除图片</div>
            <input class="none" id='ci-img-file' value="https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=3231897502,2872604692&fm=58&bpow=400&bpoh=256">
        </div>
        <div class="null15"></div>
        <div class="content-p">
            <div class="cp-textarea" contenteditable="false">
                删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落
                删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,删除段落,
                删除段落,
            </div>
            <div class="cp-but">删除段落</div>
        </div>
        <div class="null15"></div>
        <div class="content-video">
            <div class="cv-video-dom">
                <div class="cv-video">
                    <!-- <iframe src="https://v.qq.com/iframe/preview.html?vid=i0745hd0yxk&amp;width=500&amp;height=375&amp;auto=0"></iframe> -->
                    <video controls="controls">
                        <source src='http://www.w3school.com.cn/i/movie.mp4' type="video/mp4" />
                    </video>
                </div>

            </div>

            <div class="cv-but">删除视频</div>
        </div>
    </div>

    <div class="null15"></div>
    <div class="null15"></div>
    <div class="content-save">保存</div>
</div>
</div>
    <script>
    function domShow(obj) {
        $('.content-section').html('');
        $('.ct-textarea').text(obj.data.articleTitle);
        var data = obj.data.articleInfo;
        var text = '';
        var img = '';
        var video = '';
        for (var i = 0; i < data.length; i++) {
            var iframe="<xmp>"+JSON.stringify(data[i])+"</xmp>";
            console.log(iframe);
            if (data[i].textType == 1) {
                console.log(data[i].textContent);
                var textContent=data[i].textContent;
                if(textContent.indexOf('src')==-1){
                    text = ' <div class="null15"></div>'
                    if(data[i].textContent.indexOf('strong')==-1){
                        text += '<div class="content-p"><div class="cp-textarea" contenteditable="false">' + data[i].textContent + '</div>';
                    }else{
                        var textDom= data[i].textContent.split('<strong>');
                        //console.log(textDom);
                        text += '<div class="content-p"><div class="cp-textarea" contenteditable="false">' +textDom[1]+ '</div>';
                    }
                    text += ' <div class="cp-but" id=text'+i+' onclick="delText('+i+')" data-text="删除段落"><span>删除段落</span>';
                    text += '<i class="none">' + iframe + '</i>';
                    text += '<span class="none obj">' + iframe + '</span>';
                    text += '</div></div>';
                    $('.content-section').append(text);
                }else {
                    var srcArr = data[i].textContent.split('src="');
                    var src0 = srcArr[1].split('">')[0];
                    var src1 = src0.split('?')[1];
                    var src = 'http://v.qq.com/txp/iframe/player.html?' + src1;

                    video = ' <div class="null15"></div>';
                    video += ' <div class="content-video"><div class="cv-video-dom"> <div class="cv-video">';
                    video += '<iframe src=' + src +
                        ' class="iframepage" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>';
                    video += '</div><div class="cv-but" id=video'+i+' onclick="delVideo('+i+')" data-text="删除视频"><span>删除视频</span>';
                    video += '<i class="none">' + iframe + '</i>';
                    video += '<span class="none obj">' + iframe + '</span>';
                    video += '</div></div>';
                    $('.content-section').append(video);
                }

            } else if (data[i].textType == 2) {
                img = '<div class="null15"></div>';
                img += '<div class="content-img">';
                img += '<img class="ci-img" src=' + data[i].textContent + ' />';
                img += '<div class="ci-del" id=img'+i+' onclick="delImg('+i+')" data-text="删除图片"><span>删除图片</span>';
                img += '<p class="none">' + JSON.stringify(data[i]) + '</p>'
                img += '<span class="none obj">' + JSON.stringify(data[i]) + '</span>';
                img += '</div></div>';
                $('.content-section').append(img);
            } else if (data[i].textType == 3) {
                //
                var srcArr = data[i].textContent.split('src="');
                var src0 = srcArr[1].split('">')[0];
                var src1 = src0.split('?')[1];
                var src = 'http://v.qq.com/txp/iframe/player.html?' + src1;
                //console.log(src);
                video = ' <div class="null15"></div>';
                video += ' <div class="content-video"><div class="cv-video-dom"> <div class="cv-video">';
                video += '<iframe src=' + src +
                    ' class="iframepage" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>';
                video += '</div><div class="cv-but" id=video'+i+' onclick="delVideo('+i+')" data-text="删除视频"><span>删除视频</span>';
                video += '<i class="none">' + iframe + '</i>';
                video += '<span class="none obj">' + iframe + '</span>';
                video += '</div></div>';
                $('.content-section').append(video);
            }
        }

    }
    //
    var obj1 = {
        "data": {
            "articleTitle": "车智汇教你如何把你的车变成智能互联网汽车？出行更安全更省钱省心",
            "articleInfo": [{
                "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                "textType": 2
            }, {
                "textContent": "先看下爱车联网后的效果1.",
                "textType": 1
            }, {
                "textContent": "<iframe allowfullscreen=\"\" class=\"video_iframe\" data-ratio=\"1.7666666666666666\" data-vidtype=\"2\" data-w=\"848\" frameborder=\"0\" src=\"https://v.qq.com/iframe/preview.html?vid=i0745hd0yxk&amp;width=500&amp;height=375&amp;auto=0\"></iframe>",
                "textType": 3
            }, {
                "textContent": "先看下爱车联网后的效果2.",
                "textType": 1
            }, {
                "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                "textType": 2
            }, {
                "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                "textType": 2
            }, {
                "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                "textType": 2
            }, {
                "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                "textType": 2
            }, {
                "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                "textType": 2
            },
                {
                    "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                    "textType": 2
                }, {
                    "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                    "textType": 2
                }, {
                    "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                    "textType": 2
                }, {
                    "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                    "textType": 2
                }, {
                    "textContent": "https://mmbiz.qpic.cn/mmbiz_jpg/XwEUXDozLl3eqeGnyNWsyVCTWnlQ2hDuuia3X3FpRUDHkXr975MP23ibksvjPgQGPomzHvISL7DAznhp1TcRLxIA/640?wx_fmt=jpeg",
                    "textType": 2
                },

            ],

        },
    };
</script>